package com.ruoyi.project.bid.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.bid.mapper.UserDownloadDetailMapper;
import com.ruoyi.project.bid.domain.UserDownloadDetail;
import com.ruoyi.project.bid.service.IUserDownloadDetailService;

/**
 * 用户下载明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-11-27
 */
@Service
public class UserDownloadDetailServiceImpl implements IUserDownloadDetailService 
{
    @Autowired
    private UserDownloadDetailMapper userDownloadDetailMapper;

    /**
     * 查询用户下载明细
     * 
     * @param id 用户下载明细ID
     * @return 用户下载明细
     */
    @Override
    public UserDownloadDetail selectUserDownloadDetailById(Long id)
    {
        return userDownloadDetailMapper.selectUserDownloadDetailById(id);
    }

    /**
     * 查询用户下载明细列表
     * 
     * @param userDownloadDetail 用户下载明细
     * @return 用户下载明细
     */
    @Override
    public List<UserDownloadDetail> selectUserDownloadDetailList(UserDownloadDetail userDownloadDetail)
    {
        return userDownloadDetailMapper.selectUserDownloadDetailList(userDownloadDetail);
    }

    /**
     * 新增用户下载明细
     * 
     * @param userDownloadDetail 用户下载明细
     * @return 结果
     */
    @Override
    public int insertUserDownloadDetail(UserDownloadDetail userDownloadDetail)
    {
        userDownloadDetail.setCreateTime(DateUtils.getNowDate());
        return userDownloadDetailMapper.insertUserDownloadDetail(userDownloadDetail);
    }

    /**
     * 修改用户下载明细
     * 
     * @param userDownloadDetail 用户下载明细
     * @return 结果
     */
    @Override
    public int updateUserDownloadDetail(UserDownloadDetail userDownloadDetail)
    {
        userDownloadDetail.setUpdateTime(DateUtils.getNowDate());
        return userDownloadDetailMapper.updateUserDownloadDetail(userDownloadDetail);
    }

    /**
     * 批量删除用户下载明细
     * 
     * @param ids 需要删除的用户下载明细ID
     * @return 结果
     */
    @Override
    public int deleteUserDownloadDetailByIds(Long[] ids)
    {
        return userDownloadDetailMapper.deleteUserDownloadDetailByIds(ids);
    }

    /**
     * 删除用户下载明细信息
     * 
     * @param id 用户下载明细ID
     * @return 结果
     */
    @Override
    public int deleteUserDownloadDetailById(Long id)
    {
        return userDownloadDetailMapper.deleteUserDownloadDetailById(id);
    }
}
